home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / Chip_2000-10_cd1.bin / zkuste / MacOS / FILES / MailCli.sit / Documentation / For developers / Creating Plugins. next >
Text File  |  2000-06-30  |  3KB  |  80 lines

  1. Creating plug-ins for MacMail
  2.  
  3.                                                                                                                         Introduction                                                                                                                        
  4.  
  5.  
  6. Creating plug-ins for MacMail is simple if you know the HyperTalk programming language. This is because, roughly, MacMail plugins are plain text files with HyperTalk code.
  7.  
  8.                                                                                                                         Plug-in file description                                                                                                                        
  9. File Type: ╥Plug╙
  10. File Creator: ╥MMcl╙
  11.  
  12. The first line of your plugin looks (exactly) like this:
  13. -- V0
  14. (that╒s a zero). This is the verison of the plug-in structure. It allows me to make more advanced plug-in structures in the future that won╒t create incompatabilities with the current MacMail.
  15. If you get that line wrong, you get this error:
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. After that, the code starts. This is plain HyperTalk code, but you have access to the following XCMDs/XFCNs:
  27.  
  28. XCMDs
  29. ListWindow
  30. WindName
  31. xDialog
  32. CreateFolder
  33. NewAnswer <╤ Use this one for all your alert dialogs! Syntax: http://welcome.to/kalleboo/
  34. Balloons()
  35. ShowList()
  36. FindFolder()
  37. GetDir()
  38. hasAppearance()
  39.  
  40. How to access the messages:
  41. listMessages() -- Returns a list of message subjects
  42. listMessageIDs() -- Returns a list of message IDs
  43. listMessageFolder(folder name) -- Returns a list of the messages in the folder specified. The global ╥FolderMessageIDs╙ is set to a list of the message IDs
  44. saveFolders listOfFolders --replaces the list of folders with the list specified.
  45. readFolders() -- Returns a list of the folders
  46. saveMessage subject, from, to, date, folder, read, bodyText --saves a new message with those properites. Returns the message ID
  47. readMessage whatToRead, ID --Reads a part of a message, can be: "subject", "from", "to", "date", "folder", "read", "body╙
  48. moveMsg ID, where --Moves a message into a folder
  49. markMsg ID -- Marks a message as read
  50. deMarkMsg ID-- Marks a message as unread
  51.  
  52.  
  53.                                                                                                                         Error handling                                                                                                                        
  54. If your code hits upon an error, MacMail will stop the execution, and slap an error dialog:
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. You might want to try to do alot of error checking yourself, so you can collect more diagnostic information.
  66.  
  67.                                                                                                                         Good Idea:                                                                                                                        
  68. If you make a plug-in, tell me (kalleboo@yahoo.com) and it might even be included in the MacMail package!
  69.  
  70.                                                                                                                         Installing plug-ins:                                                                                                                        
  71. Pop the plug-in file into the ╥MacMail╙ folder in the ╥Applications Support╙ folder in the system folder.
  72. If you╒re using an OS older than 8.0, it╒ll be directly in the System Folder.
  73.  
  74.                                                                                                                         File name constraints:                                                                                                                        
  75. No commas in the filename. No carriage return in the filename. (a.k.a. return) Nothin gelse freakt in the filename.
  76.  
  77. -Karl B